/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managerBeanViews;

import entity.Complaint;
import entity.Solution;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import processor.ComplaintFacade;
import processor.SolutionFacade;

/**
 *
 * @author maynoigi
 */
@ManagedBean
@SessionScoped
public class ComplaintsDetails {
    @EJB
    private SolutionFacade solutionFacade;

    @EJB
    private ComplaintFacade complaintFacade;
    
    /**
     * Creates a new instance of ComplaintsDetails
     */
    public ComplaintsDetails() {
    }
    private Complaint complaints;
    private List<Solution>  Solutions;
    public List<Solution> getSolutions() {
        return Solutions;
    }

    public void setSolutions(List<Solution> Solutions) {
        this.Solutions = Solutions;
    }
 
    public Complaint getComplaints() {
        return complaints;
    }

    public void setComplaints(Complaint complaints) {

        this.complaints = complaints;
    }

    public String directionComplaints(Integer id,Complaint complaint) {
        complaints = complaintFacade.getComplaintByComplaintsID(id);
        Solutions=solutionFacade.getSolutionByComplaintsID(complaint);
        if(Solutions.size()==0)
            Solutions=null;
        return "complaintsDetail.xhtml";
    }
    
    
   
}
